import { createRouter, createWebHistory } from "vue-router";

//路由数组
const routes = [{
    name: "home",
    path: "/home",
    component: () => import("@/components/views/Home.vue"),
    children: [{
        name: "member",
        path: "/member",
        component: () => import("@/components/views/Member.vue")
    }]
}, {
    name: "index",
    path: "/",
    redirect: "/home"
}, {
    name: "login",
    path: "/login",
    component: () => import("@/components/views/Login.vue")
}];

//路由派发器
const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router;